<?php
	$val = Lemar_Basic::ObjectToArray($this->oItem);
	
?>
<form action="/admin/user/edit" method="post" enctype="multipart/form-data">
	<input type="hidden" name="id" value="<?php echo $val['id']; ?>" />
	<div class="hdr">User Information</div>
		<div class="cleft">

<p>
            <div>
                <em class="required">*</em>
                <label for="email">E-mail</label>
                <input type="text" value="<?php  if (isset($val['email'])) echo $val['email'];?>" name="email" 
                        id="email" maxlength="255" tabindex="1" />
            </div>
            <?php if(isset($this->aError['email'])) { foreach($this->aError['email'] as $ErrName => $ErrDescr) { ?>
                <div class="error_msg"><?php echo $ErrDescr; ?></div>
            <?php } } ?>

</p>

<p>
            <div>
                <em class="required">*</em>
                <label for="name">Name</label>
                <input type="text" value="<?php  if (isset($val['name'])) echo $val['name'];?>" name="name" 
                        id="name" maxlength="255" tabindex="2" />
            </div>
            <?php if(isset($this->aError['name'])) { foreach($this->aError['name'] as $ErrName => $ErrDescr) { ?>
                <div class="error_msg"><?php echo $ErrDescr; ?></div>
            <?php } } ?>

</p>
<p>
            <div>
                <em class="required">*</em>
                <label for="password">Password</label>
                <input type="text" value="<?php  if (isset($val['password'])) echo $val['password'];?>" name="password" 
                        id="password" maxlength="255" tabindex="3" />
            </div>
            <?php if(isset($this->aError['name'])) { foreach($this->aError['name'] as $ErrName => $ErrDescr) { ?>
                <div class="error_msg"><?php echo $ErrDescr; ?></div>
            <?php } } ?>

</p>

<p>
            <div>
                <em class="required">*</em>
                <label for="role">Role</label>
                <select  name="role">
                    <option value="user" <?php  echo 'user' == $val['role'] ? 'selected' : ''?>>user</option>
                    <option value="admin" <?php echo 'admin' == $val['role'] ? 'selected' : ''?>>admin</option>
                </select>

            </div>
            <?php if(isset($this->aError['role'])) { foreach($this->aError['role'] as $ErrName => $ErrDescr) { ?>
                <div class="error_msg"><?php echo $ErrDescr; ?></div>
            <?php } } ?>

</p>

<p>
            <div>
                <em class="required">*</em>
                <label for="freestyle_project">FreeStyle project</label>
                <select  name="freestyle_project">
                    <option value="1" <?php  echo '1' == $val['freestyle_project'] ? 'selected' : ''?>>ON</option>
                    <option value="0" <?php echo '0' == $val['freestyle_project'] ? 'selected' : ''?>>OFF</option>
                </select>

            </div>
            <?php if(isset($this->aError['freestyle_project'])) { foreach($this->aError['freestyle_project'] as $ErrName => $ErrDescr) { ?>
                <div class="error_msg"><?php echo $ErrDescr; ?></div>
            <?php } } ?>

</p>

<p>
			<input type="submit" value="Save" /></input>
</p>
		</div>	
</form>